package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"os/exec"
)

func main() {
	cmd := exec.Command("go", "run", "code/code-user/main.go")
	var stdout, stderr bytes.Buffer
	cmd.Stdout = &stdout
	cmd.Stderr = &stderr
	stdinPipe, err := cmd.StdinPipe()
	if err != nil {
		log.Fatal("Error creating stdin pipe:", err)
	}
	io.WriteString(stdinPipe, "12 12\n")
	if outErr := cmd.Run(); outErr != nil {
		log.Fatal("Error running command:", stderr.String())
	}
	fmt.Println("stdout:", stdout.String())
}
